/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ws;

import ejb.CatalogoManagerLocal;
import entities.Categoria;
import entities.Prodotto;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author sflesca
 */
@WebService(serviceName = "NewWebService", wsdlLocation = "WEB-INF/wsdl/NewWebService.wsdl")
@Stateless()
public class NewWebService {
    @EJB
    private CatalogoManagerLocal ejbRef;// Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

    @WebMethod(operationName = "getCategorie")
    public List<Categoria> getCategorie() {
        return ejbRef.getCategorie();
    }

    @WebMethod(operationName = "getProdotti")
    public List<Prodotto> getProdotti(@WebParam(name = "categoria") Categoria categoria, @WebParam(name = "inizio") int inizio, @WebParam(name = "numero") int numero) {
        return ejbRef.getProdotti(categoria, inizio, numero);
    }
    
}
